//
//  main.cpp
//  coin
//
//  Created by Wong Hui Hern on 2023/12/22.
//

#include <iostream>
#include "coin.h"

using namespace std;

void test1(){
    coin A(62);
    vector<int> coins={1,5,10,25};
    cout<<"The minimum amount of coins is "<<A.back_counting()<<endl;
    coin B(62,3,3,3,3);
    int ans=B.fcounting();
    if(ans!=-1){
        cout<<"It fits to minimum amount of coins, which is "<<ans<<endl;
    }
    else{
        cout<<"It has no enough amount of coins to reach the minimum."<<endl;
    }
}
void test2(){
    coin A(41);
    vector<int> coins={1,5,10,25};
    cout<<"The minimum amount of coins is "<<A.back_counting()<<endl;
    coin B(41,1,1,1,1);
    int ans=B.fcounting();
    if(ans!=-1){
        cout<<"It fits to minimum amount of coins, which is "<<ans<<endl;
    }
    else{
        cout<<"It has no enough amount of coins to reach the minimum."<<endl;
    }
}
void test3(){
    coin A(40);
    vector<int> coins={1,5,10,25};
    cout<<"The minimum amount of coins is "<<A.back_counting()<<endl;
    coin B(40,1,0,1,1);
    int ans=B.fcounting();
    if(ans!=-1){
        cout<<"It fits to minimum amount of coins, which is "<<ans<<endl;
    }
    else{
        cout<<"It has no enough amount of coins to reach the minimum."<<endl;
    }
}
void test4(){
    coin A(100);
    vector<int> coins={1,5,10,25};
    cout<<"The minimum amount of coins is "<<A.back_counting()<<endl;
    coin B(100,0,0,0,4);
    int ans=B.fcounting();
    if(ans!=-1){
        cout<<"It fits to minimum amount of coins, which is "<<ans<<endl;
    }
    else{
        cout<<"It has no enough amount of coins to reach the minimum."<<endl;
    }
}
void test5(){
    coin A(0);
    vector<int> coins={1,5,10,25};
    cout<<"The minimum amount of coins is "<<A.back_counting()<<endl;
    coin B(0,3,3,3,3);
    int ans=B.fcounting();
    if(ans!=-1){
        cout<<"It fits to minimum amount of coins, which is "<<ans<<endl;
    }
    else{
        cout<<"It has no enough amount of coins to reach the minimum."<<endl;
    }
}
int main(int argc, const char * argv[]) {
    cout<<"---amount = 62---"<<endl;
    test1();
    cout<<endl<<"---amount = 41---"<<endl;
    test2();
    cout<<endl<<"---amount = 40---"<<endl;
    test3();
    cout<<endl<<"---amount = 100---"<<endl;
    test4();
    cout<<endl<<"---amount = 0---"<<endl;
    test5();
    return 0;
}
